from django.conf import settings

class ApplicationSettings(object):

    def __init__(self, app_name):
        self.app_name = app_name.upper()

    def __getattribute__(self, attr):
        if attr == 'app_name':
            return super(ApplicationSettings, self).__getattribute__('app_name')
        global_name = '%s_%s' % (self.app_name, attr)
        return getattr(settings, global_name, 
                       super(ApplicationSettings, self).__getattribute__(attr))

    DEBUG = True
    AUTH_COMPONENT = 'net.skwx.macana.NoAuthentication'
